package com.atguigu.classroom.CourseClient;

import com.atguigu.classroom.model.vod.Course;
import com.atguigu.classroom.model.vod.Teacher;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
@Api(tags = "课程远程调用接口")
@Service
@FeignClient(value = "service-vod")
public interface CourseFeignClient {
    @ApiOperation("远程调用接口微信公众号模糊查询课程名")
    @GetMapping("/api/vod/course/inner/findByKeyword/{keyword}")
    public List<Course> findByKeyword(@PathVariable String keyword);

    @ApiOperation("根据ID查询课程基本信息")
    @GetMapping("/api/vod/course/inner/getById/{courseId}")
    public Course getById(@PathVariable Long courseId);

    @ApiOperation("根据id集合查询讲师")
    @PostMapping("/api/vod/teacher/inner/getTeacherByIds")
    public List<Teacher> getTeachers(@RequestBody List<Long> ids);
}
